package com.biz.primus.ms.sms.service.checker;

import com.biz.primus.model.misc.exception.ApiException;
import com.biz.primus.model.misc.vo.ChannelBasedAuth;
import com.biz.primus.ms.sms.service.internal.ChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yanweijin
 * @date 2017/5/31
 */
@Component
public class ChannelChecker extends SendCheckerAdapter {

	@Autowired
	private ChannelService channelService;

	@Override
	public void check(ChannelBasedAuth cba) throws ApiException {
		channelService.checkEnableAndMatchedToken(cba);
	}

	@Override
	public int getOrder() {
		return -100;
	}
}
